package com.yun.zhong.fu.sharecenter.spring_origiond_code_study;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

/**
 * @Author RenPu
 * @Date 2022/10/23 16:44
 * @Version 1.0
 * @Description: 定义事件监听器
 **/
public class MyListener implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent event) {

        if(event instanceof MyEvent){
            ((MyEvent)event).event();
        }

    }
}
